import request from '@/utils/request';
import { toFormData } from '@/utils/utils.jsx';
import { stringify } from 'qs';

//二类户支持的银行列表
export async function getLimitBankListOp() {
  return request(`/zjf-pays/openAccount/banks`);
}

//提交身份证信息
export async function submitCardOp(params) {
  return request(`/zjf-pays/openAccount/submitCard`, {
    method: 'Post',
    body: toFormData(params),
  });
}

//绑卡发送短信
export async function bindCardSendSmsOp(params) {
  return request(`/zjf-pays/openAccount/bindCardSendSms`, {
    method: 'Post',
    data: params,
  });
}

//代扣签约前置检查
export async function preCheckOp(params) {
  return request(`/zjf-pays/openAccount/preCheck`, {
    method: 'Post',
    data: params,
  });
}

//开户并绑卡
export async function openAndBindCardOp(params) {
  return request(`/zjf-pays/openAccountV3/bindCard`, {
    method: 'Post',
    data: params,
  });
}

//提交认证信息
export async function submitAttestation(params) {
  return request(`/zjf-pays/openAccountV3/submitAttestation`, {
    method: 'Post',
    data: params,
  });
}

//查看图片
export async function getImg(params) {
  return request(`/zjf-pays/imgOcr/getImg?${stringify(params)}`);
}

//获取认证信息-图片解密 用于修改认证信息、开户前确认
export async function getAttestationJM(params) {
  return request(`/zjf-pays/openAccount/getAttestationJM?${stringify(params)}`);
}

//银行验证资料
export async function bankValidate(params) {
  return request(`/zjf-pays/openAccountV3/bankValidate`, {
    method: 'Post',
    data: params,
  });
}

//大用户开户
export async function userOpenAccount(params) {
  return request(`/zjf-pays/panAddData/userOpenAccount`, {
    method: 'Post',
    body: toFormData(params),
  });
}

//获取认证信息
export async function getAttestation(params) {
    return request(`/zjf-pays/openAccount/getAttestationJM?${stringify(params)}`);
  }

//激活账户发送短信
export async function activateAccountSendSms(params) {
    return request(`/zjf-pays/openAccountV3/activateAccountSendSms?${stringify(params)}`);
  }

//确定激活账户 0：失败，1：成功
export async function activateAccount(params) {
    return request(`/zjf-pays/openAccountV3/activateAccount`, {
      method: 'Post',
      data: params,
    });
  }


//查询平安账户状态和绑卡信息
export async function queryPingAnAccount(params) {
    return request(`/zjf-pays/openAccountV3/queryPingAnAccount?${stringify(params)}`);
  }

//二类户绑已存在的卡
  export async function bindExistsCard(params) {
    return request(`/zjf-pays/openAccountV3/bindExistsCard`, {
      method: 'Post',
      data: params,
    });
  }

//二类户绑一个新卡发送短信
export async function bindNewCardSendSms(params) {
    return request(`/zjf-pays/openAccountV3/bindNewCardSendSms`, {
      method: 'Post',
      data: params,
    });
  }

//开户并绑卡
export async function bindNewCard(params) {
    return request(`/zjf-pays/openAccountV3/bindNewCard`, {
      method: 'Post',
      data: params,
    });
  }

//解绑发送短信
export async function unbindCardSendSms(params) {
    return request(`/zjf-pays/openAccountV3/unbindCardSendSms`, {
      method: 'Post',
      data: params,
    });
  }

//确定解绑卡
export async function unbindCard(params) {
    return request(`/zjf-pays/openAccountV3/unbindCard`, {
      method: 'Post',
      data: params,
    });
  }

  //职业分页
export async function getPanoccupationList(params) {
    return request(`/zjf-pays/panoccupation/list?${stringify(params)}`);
  }
  
  //平安地址编码库-级联
  export async function getAllArea(params) {
    return request(`/zjf-pays/panarea/all?${stringify(params)}`);
  }
  
  //身份证地址解析
  export async function addressParse(params) {
    return request(`/zjf-pays/openAccountV3/addressParse?${stringify(params)}`);
  }